﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
using LibHuman;

namespace Human
{
	public class frmbc_pctructangcuong: System.Windows.Forms.Form
	{
        private AccessData mDB = new AccessData();
        Language lan = new Language();
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.TextBox txtnam;
		private System.Windows.Forms.Button buttonbcao;
        private System.Windows.Forms.Button buttonkethuc;
        private string thang = "", nam = "", s_mmyy = "", sql = "", _mloai="",user_dn="";
		private System.Windows.Forms.TextBox txtthang;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.ToolTip toolTip1;
        private System.Windows.Forms.ComboBox combodvi;
        private ComboBox cboLoainv;
        private Label label3;
        private GroupBox groupBox2;
        private GroupBox groupKx;
        private RadioButton rd_tonghop;
        private RadioButton rd_chitiet;
		private System.ComponentModel.IContainer components;

		public frmbc_pctructangcuong(string s_userdn)
		{			
			InitializeComponent();
            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            user_dn = s_userdn;
		}
		
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmbc_pctructangcuong));
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.txtnam = new System.Windows.Forms.TextBox();
            this.buttonkethuc = new System.Windows.Forms.Button();
            this.buttonbcao = new System.Windows.Forms.Button();
            this.txtthang = new System.Windows.Forms.TextBox();
            this.label5 = new System.Windows.Forms.Label();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.combodvi = new System.Windows.Forms.ComboBox();
            this.cboLoainv = new System.Windows.Forms.ComboBox();
            this.label3 = new System.Windows.Forms.Label();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.groupKx = new System.Windows.Forms.GroupBox();
            this.rd_tonghop = new System.Windows.Forms.RadioButton();
            this.rd_chitiet = new System.Windows.Forms.RadioButton();
            this.groupBox2.SuspendLayout();
            this.groupKx.SuspendLayout();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.Color.Navy;
            this.label1.Location = new System.Drawing.Point(40, 18);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(54, 20);
            this.label1.TabIndex = 26;
            this.label1.Text = "Tháng :";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label2
            // 
            this.label2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.Color.Navy;
            this.label2.Location = new System.Drawing.Point(38, 43);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(56, 20);
            this.label2.TabIndex = 27;
            this.label2.Text = "Đơn vị :";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // txtnam
            // 
            this.txtnam.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtnam.ForeColor = System.Drawing.Color.Navy;
            this.txtnam.Location = new System.Drawing.Point(198, 17);
            this.txtnam.MaxLength = 4;
            this.txtnam.Name = "txtnam";
            this.txtnam.Size = new System.Drawing.Size(59, 22);
            this.txtnam.TabIndex = 1;
            this.txtnam.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            this.txtnam.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtnam_KeyDown);
            this.txtnam.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtthang_KeyPress);
            // 
            // buttonkethuc
            // 
            this.buttonkethuc.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonkethuc.ForeColor = System.Drawing.Color.Navy;
            this.buttonkethuc.Image = global::Human.Properties.Resources.close_r;
            this.buttonkethuc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.buttonkethuc.Location = new System.Drawing.Point(129, 136);
            this.buttonkethuc.Name = "buttonkethuc";
            this.buttonkethuc.Size = new System.Drawing.Size(76, 28);
            this.buttonkethuc.TabIndex = 7;
            this.buttonkethuc.Text = "    &Thoát";
            this.toolTip1.SetToolTip(this.buttonkethuc, "Kết thúc");
            this.buttonkethuc.Click += new System.EventHandler(this.buttonkethuc_Click);
            // 
            // buttonbcao
            // 
            this.buttonbcao.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonbcao.ForeColor = System.Drawing.Color.Navy;
            this.buttonbcao.Image = global::Human.Properties.Resources.ok1;
            this.buttonbcao.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.buttonbcao.Location = new System.Drawing.Point(48, 136);
            this.buttonbcao.Name = "buttonbcao";
            this.buttonbcao.Size = new System.Drawing.Size(76, 28);
            this.buttonbcao.TabIndex = 5;
            this.buttonbcao.Text = "   &Báo cáo";
            this.toolTip1.SetToolTip(this.buttonbcao, "Báo cáo");
            this.buttonbcao.Click += new System.EventHandler(this.xem_Click);
            // 
            // txtthang
            // 
            this.txtthang.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtthang.ForeColor = System.Drawing.Color.Navy;
            this.txtthang.Location = new System.Drawing.Point(95, 17);
            this.txtthang.MaxLength = 2;
            this.txtthang.Name = "txtthang";
            this.txtthang.Size = new System.Drawing.Size(56, 22);
            this.txtthang.TabIndex = 0;
            this.txtthang.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            this.txtthang.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtthang_KeyDown);
            this.txtthang.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtthang_KeyPress);
            // 
            // label5
            // 
            this.label5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label5.ForeColor = System.Drawing.Color.Navy;
            this.label5.Location = new System.Drawing.Point(154, 18);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(43, 18);
            this.label5.TabIndex = 37;
            this.label5.Text = " Năm :";
            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // combodvi
            // 
            this.combodvi.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.combodvi.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.combodvi.ForeColor = System.Drawing.Color.Navy;
            this.combodvi.ItemHeight = 14;
            this.combodvi.Location = new System.Drawing.Point(95, 43);
            this.combodvi.Name = "combodvi";
            this.combodvi.Size = new System.Drawing.Size(161, 22);
            this.combodvi.TabIndex = 2;
            this.combodvi.KeyDown += new System.Windows.Forms.KeyEventHandler(this.combodvi_KeyDown);
            // 
            // cboLoainv
            // 
            this.cboLoainv.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboLoainv.ForeColor = System.Drawing.Color.Navy;
            this.cboLoainv.ItemHeight = 14;
            this.cboLoainv.Location = new System.Drawing.Point(95, 68);
            this.cboLoainv.Name = "cboLoainv";
            this.cboLoainv.Size = new System.Drawing.Size(161, 22);
            this.cboLoainv.TabIndex = 42;
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.ForeColor = System.Drawing.Color.Navy;
            this.label3.Location = new System.Drawing.Point(14, 72);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(80, 13);
            this.label3.TabIndex = 43;
            this.label3.Text = "Loại nhân viên:";
            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.groupKx);
            this.groupBox2.Controls.Add(this.buttonbcao);
            this.groupBox2.Controls.Add(this.buttonkethuc);
            this.groupBox2.Location = new System.Drawing.Point(7, 1);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(259, 169);
            this.groupBox2.TabIndex = 44;
            this.groupBox2.TabStop = false;
            // 
            // groupKx
            // 
            this.groupKx.Controls.Add(this.rd_tonghop);
            this.groupKx.Controls.Add(this.rd_chitiet);
            this.groupKx.Location = new System.Drawing.Point(36, 95);
            this.groupKx.Name = "groupKx";
            this.groupKx.Size = new System.Drawing.Size(191, 35);
            this.groupKx.TabIndex = 42;
            this.groupKx.TabStop = false;
            this.groupKx.Tag = "0";
            // 
            // rd_tonghop
            // 
            this.rd_tonghop.AutoSize = true;
            this.rd_tonghop.Location = new System.Drawing.Point(111, 12);
            this.rd_tonghop.Name = "rd_tonghop";
            this.rd_tonghop.Size = new System.Drawing.Size(70, 17);
            this.rd_tonghop.TabIndex = 1;
            this.rd_tonghop.Text = "Tổng hợp";
            this.rd_tonghop.UseVisualStyleBackColor = true;
            // 
            // rd_chitiet
            // 
            this.rd_chitiet.AutoSize = true;
            this.rd_chitiet.Checked = true;
            this.rd_chitiet.Location = new System.Drawing.Point(17, 12);
            this.rd_chitiet.Name = "rd_chitiet";
            this.rd_chitiet.Size = new System.Drawing.Size(59, 17);
            this.rd_chitiet.TabIndex = 0;
            this.rd_chitiet.TabStop = true;
            this.rd_chitiet.Text = "Chi tiết";
            this.rd_chitiet.UseVisualStyleBackColor = true;
            // 
            // frmbc_pctructangcuong
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
            this.ClientSize = new System.Drawing.Size(270, 170);
            this.Controls.Add(this.cboLoainv);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.txtthang);
            this.Controls.Add(this.txtnam);
            this.Controls.Add(this.combodvi);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.groupBox2);
            this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MinimizeBox = false;
            this.Name = "frmbc_pctructangcuong";
            this.ShowIcon = false;
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Phụ cấp trực tăng cường";
            this.Load += new System.EventHandler(this.frmbcttluong_Load);
            this.groupBox2.ResumeLayout(false);
            this.groupKx.ResumeLayout(false);
            this.groupKx.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

		}
		#endregion

		private void buttonkethuc_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}
		
		private void frmbcttluong_Load(object sender, System.EventArgs e)
		{
            thang = txtthang.Text = DateTime.Now.Month.ToString().PadLeft(2, '0');
            nam = txtnam.Text = DateTime.Now.Year.ToString();
            s_mmyy = thang + nam.Substring(2, 2);
			load_bophan();
            loadhopdong(); 
  		}

        private void loadhopdong()
        {
            cboLoainv.DataSource = mDB.get_nhombc().Tables[0];
            cboLoainv.DisplayMember = "tennhom";
            cboLoainv.ValueMember = "manhom";
            cboLoainv.SelectedIndex = -1;
        }
		
		private void load_bophan()
		{
			combodvi.DataSource=mDB.get_bophan().Tables[0];
			combodvi.DisplayMember="tenbp";
			combodvi.ValueMember="madv";
            combodvi.SelectedIndex = -1;		
		}
        private void print()
		{					
			try	{
	            // khu vuc thuong
				sql = "  ( select to_char(now(),'dd') as n_ngay,to_char(now(),'mm') as n_thang,to_char(now(),'yyyy') as n_nam, ";
                sql +=" l.ho||' '||l.ten as hoten,bp.madv,bp.tenbp,";
                sql += " cv.diengiai,'Mức Bình Thường' as muc,cc.tc_ngaythuong,cc.tc_chunhat,cc.tc_letet,hs.pctc_nt,hs.pctc_cn,hs.pctc_lt ";
                sql +=" from " + mDB.user + ".llnv l ";
                sql +=" inner join " + mDB.user + ".hopdong hd on l.manv = hd.manv ";
                sql +=" left  join " + mDB.user + ".dmcv cv on cv.macv = hd.macv ";
                sql +=" inner join " + mDB.user + ".bophan bp on l.madv = bp.madv";
                sql +=" inner join " + mDB.user + ".th_chamcong_" + s_mmyy + " cc on cc.manv=l.manv ";
                sql +=" inner join "+ mDB.user + ".heso hs on hs.mmyy=cc.mmyy ";
                sql += "inner join " + mDB.user + ".mahd mh on mh.mahd = hd.loaihd ";
                sql += "inner join " + mDB.user + ".nhombc bc on bc.manhom = mh.nhombc ";
                sql += " where (cc.tc_ngaythuong >0 or cc.tc_chunhat >0 or cc.tc_letet>0) ";
                
                if (combodvi.SelectedIndex >= 0)
                    sql += " and bp.madv='" + combodvi.SelectedValue.ToString() + "'";
                if (cboLoainv.SelectedIndex != -1)
                {
                    sql += " and bc.manhom in (" + cboLoainv.SelectedValue.ToString()+ ")";
                    _mloai = cboLoainv.Text.ToUpper();
                }
                sql += "  order by bp.sothutu,cv.stt)";

                sql += " union ";

                // khu vuc hoi suc
                sql += "  (select to_char(now(),'dd') as n_ngay,to_char(now(),'mm') as n_thang,to_char(now(),'yyyy') as n_nam, ";
                sql += "  l.ho||' '||l.ten as hoten,bp.madv,bp.tenbp,";
                sql += "  cv.diengiai,'Mức Đặc Biệt' as muc,cc.htc_ngaythuong,cc.htc_chunhat,cc.htc_letet,hs.hpctc_nt,hs.hpctc_cn,hs.hpctc_lt ";
                sql += "  from " + mDB.user + ".llnv l ";
                sql += "  inner join " + mDB.user + ".hopdong hd on l.manv = hd.manv ";
                sql += "  left join  " + mDB.user + ".dmcv cv on cv.macv = hd.macv ";
                sql += "  inner join " + mDB.user + ".bophan bp on l.madv = bp.madv ";
                sql += "  inner join " + mDB.user + ".th_chamcong_" + s_mmyy + " cc on cc.manv=l.manv ";
                sql += "  inner join " + mDB.user + ".heso hs on hs.mmyy=cc.mmyy ";
                sql += "  inner join " + mDB.user + ".mahd mh on mh.mahd = hd.loaihd ";
                sql += "  inner join " + mDB.user + ".nhombc bc on bc.manhom = mh.nhombc ";
                sql += "  where (cc.htc_ngaythuong >0 or cc.htc_chunhat >0 or cc.htc_letet >0) ";
                
                if (combodvi.SelectedIndex >= 0)
                    sql += " and bp.madv='" + combodvi.SelectedValue.ToString() + "'";
                if (cboLoainv.SelectedIndex != -1)
                {
                    sql += " and bc.manhom in (" + cboLoainv.SelectedValue.ToString() + ")";
                    _mloai = cboLoainv.Text.ToUpper();
                }
                sql += "  order by bp.sothutu,cv.stt)";

                DataSet ds = new DataSet();
				ds=mDB.get_data(sql);
                ds.WriteXml("..\\xml\\h_pc_tangcuong_ct.xml", XmlWriteMode.WriteSchema);									
				if (ds.Tables[0].Rows.Count>0)
				{
                    //if(i==0)
                    //{
                        frmReport rpt = new frmReport(mDB, ds,lan.Change_language_MessageText( "THÁNG ") +" "+  thang+" " + lan.Change_language_MessageText(" NĂM ") +" "+ nam+" ", "h_pc_tangcuong_ct.rpt", true, user_dn);
						rpt.ShowDialog(this);
                    //}									
				}
				else
					MessageBox.Show(lan.Change_language_MessageText("Không có dữ liệu !"),this.Text,MessageBoxButtons.OK,MessageBoxIcon.Warning);
			}
			catch(Exception ex)
			{	
				MessageBox.Show(ex.ToString());
			}		
		}
        private void print1()
        {
            try
            {
                // khu vuc thuong
                sql = "  ( select to_char(now(),'dd') as n_ngay,to_char(now(),'mm') as n_thang,to_char(now(),'yyyy') as n_nam, ";
                sql += " bp.madv,bp.tenbp,";
                sql += " 'Mức Bình Thường' as muc,sum(cc.tc_ngaythuong) as tc_ngaythuong,sum(cc.tc_chunhat) as tc_chunhat,sum(cc.tc_letet) tc_letet ,hs.pctc_nt ,hs.pctc_cn,hs.pctc_lt ";
                sql += " from " + mDB.user + ".llnv l ";
                sql += " inner join " + mDB.user + ".hopdong hd on l.manv = hd.manv ";
                sql += " left  join " + mDB.user + ".dmcv cv on cv.macv = hd.macv ";
                sql += " inner join " + mDB.user + ".bophan bp on l.madv = bp.madv";
                sql += " inner join " + mDB.user + ".th_chamcong_" + s_mmyy + " cc on cc.manv=l.manv ";
                sql += " inner join " + mDB.user + ".heso hs on hs.mmyy=cc.mmyy ";
                sql += "inner join " + mDB.user + ".mahd mh on mh.mahd = hd.loaihd ";
                sql += "inner join " + mDB.user + ".nhombc bc on bc.manhom = mh.nhombc ";
                sql += " where (cc.tc_ngaythuong >0 or cc.tc_chunhat >0 or cc.tc_letet>0) ";

                if (combodvi.SelectedIndex >= 0)
                    sql += " and bp.madv='" + combodvi.SelectedValue.ToString() + "'";
                if (cboLoainv.SelectedIndex != -1)
                {
                    sql += " and bc.manhom in (" + cboLoainv.SelectedValue.ToString() + ")";
                    _mloai = cboLoainv.Text.ToUpper();
                }
                sql += " group by bp.madv,bp.tenbp,hs.pctc_nt,hs.pctc_cn,hs.pctc_lt)";
                sql += " union ";

                // khu vuc hoi suc
                sql += "  (select to_char(now(),'dd') as n_ngay,to_char(now(),'mm') as n_thang,to_char(now(),'yyyy') as n_nam, ";
                sql += "  bp.madv,bp.tenbp,";
                sql += "  'Mức Đặc Biệt' as muc,sum(cc.htc_ngaythuong) htc_ngaythuong,sum(cc.htc_chunhat) htc_chunhat,sum(cc.htc_letet) htc_letet,hs.hpctc_nt,hs.hpctc_cn,hs.hpctc_lt ";
                sql += "  from " + mDB.user + ".llnv l ";
                sql += "  inner join " + mDB.user + ".hopdong hd on l.manv = hd.manv ";
                sql += "  left join  " + mDB.user + ".dmcv cv on cv.macv = hd.macv ";
                sql += "  inner join " + mDB.user + ".bophan bp on l.madv = bp.madv ";
                sql += "  inner join " + mDB.user + ".th_chamcong_" + s_mmyy + " cc on cc.manv=l.manv ";
                sql += "  inner join " + mDB.user + ".heso hs on hs.mmyy=cc.mmyy ";
                sql += "  inner join " + mDB.user + ".mahd mh on mh.mahd = hd.loaihd ";
                sql += "  inner join " + mDB.user + ".nhombc bc on bc.manhom = mh.nhombc ";
                sql += "  where (cc.htc_ngaythuong >0 or cc.htc_chunhat >0 or cc.htc_letet >0) ";

                if (combodvi.SelectedIndex >= 0)
                    sql += " and bp.madv='" + combodvi.SelectedValue.ToString() + "'";
                if (cboLoainv.SelectedIndex != -1)
                {
                    sql += " and bc.manhom in (" + cboLoainv.SelectedValue.ToString() + ")";
                    _mloai = cboLoainv.Text.ToUpper();
                }
                sql += " group by bp.madv,bp.tenbp,hs.hpctc_nt,hs.hpctc_cn,hs.hpctc_lt)";
             
                DataSet ds = new DataSet();
                ds = mDB.get_data(sql);
                ds.WriteXml("..\\xml\\h_pc_tangcuong_th.xml", XmlWriteMode.WriteSchema);
                if (ds.Tables[0].Rows.Count>0)
                {
                    //if (i == 0)
                    //{
                        frmReport rpt = new frmReport(mDB, ds, lan.Change_language_MessageText("THÁNG ") +" "+ thang +" "+ lan.Change_language_MessageText(" NĂM ") +" "+ nam +" ", "h_pc_tangcuong_th.rpt", true, user_dn);
                        rpt.ShowDialog(this);
                    //}
                }
                else
                    MessageBox.Show(lan.Change_language_MessageText("Không có dữ liệu !"), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }						
		private void xem_Click(object sender, System.EventArgs e)
		{
			if(!mDB.kt_thangnam(thang,nam))	 return;           
            if (!mDB.bMmyy(s_mmyy) || !mDB.kt_heso(s_mmyy))
			{
				MessageBox.Show(lan.Change_language_MessageText("Dữ liệu chưa tạo !"),lan.Change_language_MessageText("Thông báo"));
				return;
			}
            if (rd_chitiet.Checked)
            {
                print();
            }
            if (rd_tonghop.Checked)
            {
                print1();
            }
		}
					
		private void txtnam_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab},{F4}");
		}

		private void cboloaihd_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab},{F4}");
		}	

		private void combodvi_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtthang_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}
        private void txtthang_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0' || e.KeyChar > '9') && e.KeyChar != '\b')
                e.KeyChar = '\0';
        }	
		
	}
}
